<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>

<title><fmt:message key="productList.title"/></title>
<content tag="heading"><fmt:message key="productList.heading"/></content>
<meta name="menu" content="ProductMenu"/>
<meta name="Robots" contect="none">

<table width="100%" height="76" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="left" valign="top" >
	  
	  
			<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
			  <tr>
				<td height="25" bgcolor="#5F9CD4" class="font01">&nbsp;&nbsp;&nbsp;系统&gt;&gt; 仓库管理&gt;&gt;产品管理</td>
			  </tr>
			  <tr>
				<td height="8"></td>
			  </tr>
			</table>

	  
			  <!---list begin--->
			  <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CDCDCD">
				<tr>
				  <td height="25" background="img/m-bt-bg01.gif" bgcolor="#FFFFFF" style="background-repeat:no-repeat;background-position:right">
				  
					  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
						  <tr>
							<td width="2%" height="24"><img src="img/dian-1.gif" width="6" height="6" /></td>
							<td width="48%" class="btn02">产品列表 </td>
							<td width="50%" align="right">
							<input type="button" style="margin-right: 5px"
        onclick="location.href='<c:url value="/editProduct.html"/>'"
        value="<fmt:message key="button.add"/>"/></td>
						  </tr>
					  </table>
			      </td>
				</tr>
				<tr>
				  <td valign="top" bgcolor="#F8F8F8">　
<display:table name="productList" cellspacing="0" cellpadding="0"
    id="product" pagesize="25" class="simple"
     requestURI="">

    <display:column property="belongDept" sortable="true" headerClass="sortable"
         titleKey="productForm.belongDept"/>
    <display:column property="sn" sortable="true" headerClass="sortable"
         titleKey="productForm.sn"/>
    <display:column property="title" sortable="true" headerClass="sortable"
         titleKey="productForm.title"/>
    <display:column property="types" sortable="true" headerClass="sortable"
         titleKey="productForm.types"/>
    <display:column property="unit" sortable="true" headerClass="sortable"
         titleKey="productForm.unit"/>
    <display:column property="salePrice" sortable="true" headerClass="sortable"
         titleKey="productForm.salePrice"/>
    <display:column property="intro" sortable="true" headerClass="sortable"
         titleKey="productForm.intro"/>
    <display:column property="inputUser" sortable="true" headerClass="sortable"
         titleKey="productForm.inputUser"/>
    <display:column property="inputTime" sortable="true" headerClass="sortable"
         titleKey="productForm.inputTime"/>
    <display:column property="initNum" sortable="true" headerClass="sortable"
         titleKey="productForm.initNum"/>
    <display:column property="planNum" sortable="true" headerClass="sortable"
         titleKey="productForm.planNum"/>
    <display:column   sortable="true" headerClass="sortable"
         titleKey="productForm.factNum">
         <c:choose>

									<c:when test="${product.factNum<product.initNum}">  
									 <script type="text/javascript">
									 alert("<c:out value="${product.title}" />"+"缺货!");
									 </script>  
									<font color=red> <c:out value="${product.factNum}" />
									</font>
  												 </c:when>

									<c:otherwise>  <c:out value="${product.factNum}" />
  													 </c:otherwise>

								</c:choose>
         </display:column>
               <display:column  titleKey="table.operating"> 
								    <a href="products.html?method=edit&id=<c:out value="${product.id}"/>">修改</a>|
								    <a href="products.html?method=delete&id=<c:out value="${product.id}"/>" onclick="bCancel=true; return confirmDelete('product')">删除</a> 
								</display:column>
    <display:setProperty name="paging.banner.item_name" value="product"/>
    <display:setProperty name="paging.banner.items_name" value="products"/>
</display:table>
 </td>
				</tr>
			  </table>
	  
	          <!---list end--->
		  
      
	</td>
  </tr>
</table>


<script type="text/javascript">
    highlightTableRows("productList");
</script>
